/*
day369 
2020.8.31 
*/
#include<iostream>
#include<vector>
#include<list>
using namespace std;

class Solution {
public:
    vector<int> processQueries(vector<int>& queries, int m) {
		list<int> l;
		for(int i=1;i<=m;++i)
		{
			l.push_back(i);
		}
		
		vector<int> res;
		for(int i=0;i<queries.size();++i)
		{
			int tem=queries[i],index=0;
			auto iter=l.begin();
			
			while(*iter!=tem)
			{
				iter++;
				index++;
			 } 
			l.erase(iter);
			l.push_front(tem);
			res.push_back(index);
		}
		return res;
    }
};

int main()
{
	return 0;
 } 
